package com.fa.wisdom.net;

import com.fa.wisdom.model.ResultEntity;

import java.io.File;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.QueryName;

public interface ApiService {


    //======================================走运家族======================================
    //登录
    @GET("api/login/login")
    Call<ResultEntity> login(@Query("name") String name, @Query("password") String password);

    //注册
    @POST("api/login/register")
    Call<ResultEntity> register(@Query("name") String name, @Query("password") String password, @Query("phone") String phone, @Query("code") String code);

    //发送验证码
    @POST("api/login/sms")
    Call<ResultEntity> sendPhoneCode(@Query("phone") String phone);

    //重置密码
    @POST("api/login/password_reset")
    Call<ResultEntity> resetPwd(@Query("phone") String phone, @Query("code") String code, @Query("password") String password);

    //修改手机号
    @POST("api/users/changeUserPhone")
    Call<ResultEntity> modifyPhone(@Query("user_id") int user_id, @Query("phone") String phone
            , @Query("code") String code);

    //编辑用户个人信息
    @POST("api/users/editUserInfo")
    Call<ResultEntity> modifyUser(@Query("user_id") int user_id, @Query("name") String name
            , @Query("avatarurl") String avatarurl, @Query("sex") int sex, @Query("age") int age);

    //上传图片
    @Multipart
    @POST("api/users/uplodfile")
    Call<ResultEntity> uploadFile(@Part MultipartBody.Part part);

    //获取用户信息
    @GET("api/users/getUserInfo")
    Call<ResultEntity> getUserInfo();

    //获取商品分类
    @POST("goods/index/goods_cate")
    Call<ResultEntity> getCate();

    //获取对应的商品信息
    @POST("goods/index/goods_list")
    Call<ResultEntity> getGoods(@Query("page_no") int page_no, @Query("page_size") int page_size, @Query("cat_id") int cat_id);

    //查看我的分组
    @GET("api/device/device_group_lists")
    Call<ResultEntity> getMyGroup(@Query("pid") int pid,@Query("user_id") int user_id, @Query("token") String token);

    @GET("api/watch/location")
    Call<ResultEntity> getMyLocation(@Query("token") String token, @Query("device_group_id") String device_group_id);


    //获取 家下面对应的 分组
    @GET("api/device/device_group_lists")
    Call<ResultEntity> getMyGroupContent(@Query("user_id") int user_id, @Query("pid") int pid, @Query("token") String token);

    //获取设备分类列表
    @GET("api/device/device_type")
    Call<ResultEntity> getClassic();

    //获取分类列表下的设备
    @GET("api/device/get_device_lists")
    Call<ResultEntity> getDeviceList(@Query("device_group_id") int device_group_id, @Query("user_id") int user_id, @Query("token") String token);

    @GET("api/device/device_alarm")
    Call<ResultEntity> getMsgList(@Query("device_group_id") int device_group_id, @Query("page") int page, @Query("token") String token);


    @POST("goods/index/getGoodsItem")
    Call<ResultEntity> getGoodDetail(@Query("goods_id") String goods_id
            ,@Query("user_id") int user_id);


    @POST("goods/020010")
    Call<ResultEntity> editAddress(@Body RequestBody addressList);

    //提交订单
    @POST("goods/020011")
    Call<ResultEntity> wxPay(@Body RequestBody orderBody);

    //生成预订单
    @POST("goods/020014")
    Call<ResultEntity> createOrder(@Body RequestBody orderBody);

    //获取用户信息
    @POST("userOperation/010011")
    Call<ResultEntity> getUserInfo(@Body RequestBody userBody);

    //添加购物车
    @POST("shopping/120001")
    Call<ResultEntity> addCat(@Body RequestBody catBody);

    //查询购物车
    @POST("shopping/120002")
    Call<ResultEntity> getCat(@Body RequestBody catBody);

    //修改购物车数量
    @POST("shopping/120003")
    Call<ResultEntity> editCat(@Body RequestBody catBody);

    //删除购物车商品
    @POST("shopping/120005")
    Call<ResultEntity> deleteCat(@Body RequestBody catBody);

    //获取首页免费兑换专区商品
    @POST("goods/020015")
    Call<ResultEntity> getFreeGoods(@Body RequestBody freeBody);

    //第一次设置支付密码 发送验证码
    @POST("userOperation/010047")
    Call<ResultEntity> sendFirstCode(@Body RequestBody codeBody);

    @POST("userOperation/010048")
    Call<ResultEntity> setFirstPwd(@Body RequestBody codeBody);

    //修改和忘记 设置验证码
    @POST("userOperation/010049")
    Call<ResultEntity> sendSecondCode(@Body RequestBody codeBody);

    @POST("userOperation/010050")
    Call<ResultEntity> setSecondPwd(@Body RequestBody codeBody);

    //支付宝支付
    @POST("goods/020020")
    Call<ResultEntity> aliPay(@Body RequestBody codeBody);

    //获取待付款订单
    @POST("userOperation/010016")
    Call<ResultEntity> getNoPayOrder(@Body RequestBody orderBody);

    //获取待发货订单
    @POST("userOperation/010017")
    Call<ResultEntity> getNoSendOrder(@Body RequestBody orderBody);

    //获取待收货订单
    @POST("userOperation/010018")
    Call<ResultEntity> getSendOrder(@Body RequestBody orderBody);

    //校验微信登录
    @POST("userOperation/010041")
    Call<ResultEntity> checkIsBind(@Body RequestBody loginBody);

    //绑定微信发送的验证码
    @POST("userOperation/010046")
    Call<ResultEntity> sendBindPhoneCode(@Body RequestBody loginBody);

    //绑定微信

    @POST("userOperation/010045")
    Call<ResultEntity> bindWXPhone(@Body RequestBody loginBody);

    //注册手机验证码
    @POST("userOperation/regCode")
    Call<ResultEntity> sendRegisterCode(@Body RequestBody loginBody);


    //获取俱乐部信息
    @POST("club/130001")
    Call<ResultEntity> getAllClub();

    //获取对应的俱乐部下面的团
    @POST("club/130002")
    Call<ResultEntity> getClubTeam(@Body RequestBody clubBody);

    //保存join信息
    @POST("association/090012")
    Call<ResultEntity> saveJoinInfo(@Body RequestBody joinBody);

    //微信支付
    @POST("association/090008")
    Call<ResultEntity> wxJoinPay(@Body RequestBody joinBody);

    //支付宝
    @POST("association/090009")
    Call<ResultEntity> aliJoinPay(@Body RequestBody joinBody);

    //查询收藏列表
    @POST("goods/020006")
    Call<ResultEntity> getAllCollect(@Body RequestBody collectBody);


    //签到
    @POST("userOperation/010043")
    Call<ResultEntity> signNow(@Body RequestBody signBody);//参数 token  signTime

    //补签
    @POST("userOperation/010044")
    Call<ResultEntity> retroactive(@Body RequestBody signBody);//参数 token  signTime

    //获取签到天数
    @POST("userOperation/010051")
    Call<ResultEntity> getSignDays(@Body RequestBody signBody);//参数 token

}